<?php /* Smarty version 2.6.18, created on 2010-03-24 08:39:19
         compiled from showcart.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'explode', 'showcart.tpl', 41, false),array('modifier', 'number_format', 'showcart.tpl', 52, false),array('function', 'cycle', 'showcart.tpl', 46, false),)), $this); ?>
<form name="mainForm" method="POST" id="mainForm">
    	<h1><?php if ($this->_tpl_vars['special_order']): ?>Special <?php endif; ?>Order Details</h1>
        <div class="blue">
		<p class="right"><input type="button" value="Back to Order" onclick="doajaxAction('/account/createorder',0,'main_content');" />   <input type="button" value="Clear Cart" onclick="doajaxAction('/account/clearCart',0,'main_content');" />  <input type="button" value="Update Cart" onclick="doajaxAction('/account/updateCart',1,'main_content',document.getElementById('mainForm'));" />     <input type="button" value="Proceed to Payment" onclick="doajaxAction('/account/proceedPayment',1,'main_content',document.getElementById('mainForm'));"/> </p>
        </div>
           
            <div id="results">
				
                <!-- **************repeat here*************** -->
                
                <div>  
					<?php $this->assign('count', 0); ?>
					<?php if ($this->_tpl_vars['orders']): ?>
					<?php $_from = $this->_tpl_vars['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['keys'] => $this->_tpl_vars['items']):
?>
						<?php if ($this->_tpl_vars['count'] == 0): ?>
						<input type="checkbox" value="1" name="blanket_po" <?php if ($this->_tpl_vars['items']['blanketpo']): ?>checked<?php endif; ?>><strong>Is Blanket P.O.</strong>
						<?php endif; ?>				
					<?php $this->assign('count', ($this->_tpl_vars['count']+1)); ?>				
					<?php if ($this->_tpl_vars['items']['totalorder'] > 0 && $this->_tpl_vars['keys'] != 'blanketpo'): ?>
					<table border="0" width="100%">
							<tr><td colspan="7"><hr></td></tr>
							<tr>
	                    			<th colspan="7"><?php echo $this->_tpl_vars['items']['supplier']; ?>
</th>
							</tr>
							<tr><td colspan="7"><hr></td></tr>
							<tr>
								<td></td>
								<td>Name</td>
								<td>Size</td>
								<td>Qty</td>
								<td>Price</td>
								<td>Cost</td>
								<td>Delete</td>
							</tr>
							<tr><td colspan="7"><hr></td></tr>
						 <?php $this->assign('grandtotal', 0); ?>							
						 <?php $_from = $this->_tpl_vars['items']['organismItem']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
							<?php $this->assign('supplier', ($this->_tpl_vars['item']['org_id'])); ?>
							<?php $_from = $this->_tpl_vars['item']['order']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['detail']):
?>
								<?php if ($this->_tpl_vars['detail'] > 0): ?>
									<?php $this->assign('orderkey', ((is_array($_tmp='_')) ? $this->_run_mod_handler('explode', true, $_tmp, $this->_tpl_vars['key']) : explode($_tmp, $this->_tpl_vars['key']))); ?>
									<?php $this->assign('sizekey', $this->_tpl_vars['orderkey']['0']); ?>
									<?php $this->assign('genderkey', $this->_tpl_vars['orderkey']['1']); ?>
									<?php $this->assign('pricekey', $this->_tpl_vars['item']['prices'][$this->_tpl_vars['key']]); ?>
									<?php $this->assign('currencykey', $this->_tpl_vars['item']['currencies'][$this->_tpl_vars['key']]); ?>
								  <tr class=<?php echo smarty_function_cycle(array('values' => "blue,notify"), $this);?>
>	
									<td width="10%" align="center"><img  onclick="PopEx(this, null, null, null, 300, 50, 'PopBoxImageLarge');" pbCaption="<i><?php echo $this->_tpl_vars['item']['scientific_name']; ?>
</i>, <?php echo $this->_tpl_vars['item']['name']; ?>
" id="trade<?php echo $this->_tpl_vars['key']; ?>
" width="50" src="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['item']['image']; ?>
.jpg" pbsrc="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['item']['image']; ?>
.jpg" class="PopBoxImageSmall" title="Click to magnify/shrink"></td>                         
									<td><?php echo $this->_tpl_vars['item']['moid']; ?>
 / <i><?php echo $this->_tpl_vars['item']['scientific_name']; ?>
</i> / <?php echo $this->_tpl_vars['item']['name']; ?>
</td>
									<td align="center">
										<?php echo $this->_tpl_vars['sizekey']; ?>
 <?php if ($this->_tpl_vars['genderkey'] <> ""): ?>(<?php echo $this->_tpl_vars['genderkey']; ?>
)<?php endif; ?>
									</td>
									<td align="right" width="80px"><input type="text" style="width:60px;text-align:right" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['detail'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
" name="user[<?php echo $this->_tpl_vars['supplier']; ?>
|<?php echo $this->_tpl_vars['item']['organism_id']; ?>
|<?php echo $this->_tpl_vars['key']; ?>
][]" id="qty[<?php echo $this->_tpl_vars['supplier']; ?>
|<?php echo $this->_tpl_vars['item']['organism_id']; ?>
|<?php echo $this->_tpl_vars['key']; ?>
]" onchange="compute('<?php echo $this->_tpl_vars['supplier']; ?>
|<?php echo $this->_tpl_vars['item']['organism_id']; ?>
|<?php echo $this->_tpl_vars['key']; ?>
')"></td>
									<td align="right"><?php echo $this->_tpl_vars['currencykey']; ?>
 <?php echo ((is_array($_tmp=$this->_tpl_vars['pricekey'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
<input type="hidden" value="<?php echo $this->_tpl_vars['pricekey']; ?>
" id="price[<?php echo $this->_tpl_vars['supplier']; ?>
|<?php echo $this->_tpl_vars['item']['organism_id']; ?>
|<?php echo $this->_tpl_vars['key']; ?>
]"></td>
									<?php $this->assign('totalamount', ($this->_tpl_vars['pricekey']*$this->_tpl_vars['detail'])); ?>
									<?php $this->assign('grandtotal', ($this->_tpl_vars['grandtotal']+$this->_tpl_vars['totalamount'])); ?>
									<td align="right"><?php echo $this->_tpl_vars['currencykey']; ?>
<input style="border:0;width:70px;text-align:right" readonly type="text" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['totalamount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
" id="amount[<?php echo $this->_tpl_vars['supplier']; ?>
|<?php echo $this->_tpl_vars['item']['organism_id']; ?>
|<?php echo $this->_tpl_vars['key']; ?>
]"></td>
									<td align="center"><input type="checkbox" name="delete[<?php echo $this->_tpl_vars['supplier']; ?>
|<?php echo $this->_tpl_vars['item']['organism_id']; ?>
|<?php echo $this->_tpl_vars['key']; ?>
][]" value="1"></td>
								  </tr>
							  	<?php endif; ?>
						  	<?php endforeach; endif; unset($_from); ?>
						 <?php endforeach; endif; unset($_from); ?>
						 <tr>
						 	<td colspan="7">&nbsp;</td>
						 </tr>			
						 <tr>
						 	<td colspan="7">&nbsp;</td>
						 </tr>	
						 <tr>
						 	<td colspan="7">&nbsp;</td>
						 </tr>							 						 			 
						 <tr style="background-color: #BEBEBE;">
						 	<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp; Total amount : </td>
							<td align="right"><?php echo $this->_tpl_vars['currencykey']; ?>
 <?php echo ((is_array($_tmp=$this->_tpl_vars['grandtotal'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
</td>
							<td>&nbsp;</td>
						 </tr>
                     </table>
                     <?php endif; ?>
					 <?php endforeach; endif; unset($_from); ?>
					 <?php else: ?>
						 <table width="100%">
							<tr>
                    			<th colspan="2">Empty Shopping Cart</th>
							</tr>
						 </table>
					 <?php endif; ?>
            	</div>                
            </div>
</form>
<script language="javascript">
<?php echo '
	function compute(key){
		var amount = document.getElementById(\'price[\'+key+\']\').value * document.getElementById(\'qty[\'+key+\']\').value;
		document.getElementById(\'amount[\'+key+\']\').value = amount.numberFormat("0,0.00");
	}
'; ?>

</script>
            
            